package cn.com.yang.socket;

import java.io.IOException;
import java.net.ServerSocket;

/**
 * 
 * TODO
 * @author yangyijin
 * @since 2023年5月13日-下午7:57:48
 */
public class LocalPortScanner {
	public static void main(String[] args) {
		for(int port=1;port<=65535;port++) {
			try {
				ServerSocket server = new ServerSocket(port);//0 随机端口
			} catch (IOException e) {
				System.out.println("There is a server on port "+port+".");
			}
		}
	}
}
